<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>

<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>添加友情链接</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	
	<link rel="stylesheet" type="text/css" href="css/add_goods.css">
	<script type="text/javascript">
		/* 校验  */
		function losefocus1(){
		
			if(document.getElementById("addressId").value==""){
				document.getElementById("null_span1").innerText="名称不能为空";
			}
				
		}
	    function getfocus1(){
		
			
			document.getElementById("null_span1").innerText="";
			
				
		}	
		function losefocus2(){
		
			if(document.getElementById("titleId").value==""){
				document.getElementById("null_span2").innerText="品牌不能为空";
			}
				
		}
	    function getfocus2(){
		
			
			document.getElementById("null_span2").innerText="";
			
				
		}	
		function jiaoyan_all(){
			var bol=true;if(document.getElementById("addressId").value==""){
				bol=false;
				alert("链接地址不能为空");
			}else if(document.getElementById("titleId").value==""){
				bol=false;
				alert("链接标题不能为空");
			}
			if(bol==true){
				alert("添加成功");
			}
			return bol;
		}
		
		function success() {
			alert("添加成功");
			
		}
	</script>

  </head>
  
  <body >
  	<!--总div  -->
     <div class="div_all">
     
     <%-- 	<div class="div_1">
     			<div style="position: absolute;">
			<c:if test="${username1!=null}">
				<span style="color:red;">用户名: ${username1}</span>
			</c:if>
			
			<!--若用户名为空，跳转到登录界面  -->
			<c:if test="${username1==null}">
				<a href="dengru.jsp" style="text-decoration: none;color:red;">亲，请登录</a>
			</c:if></div>
			<!-- <div class="div_menu">
				<a href="add_goods_showtype.do" class="a_menu">添加商品 </a>
  				<a href="show_goods.do" class="a_menu">查询商品 </a>
  				<a href="add_type.do" class="a_menu">类别管理 </a>
  				<a href="show_ads.do" class="a_menu">广告维护 </a>
  				<a href="zhuce.jsp" class="a_menu">注册账号 </a>
  				<a href="qiehuanUser.do" class="a_menu">切换账号 </a>
  				<a href="select_orders.do" class="a_menu">订单查询 </a>
  				<a href="go_tongji.do" class="a_menu">销售统计 </a>
			</div> -->
     	</div> --%>
     	
     	<div class="div_2">
     		<!-- 添加div -->
     		<div class="div_add">
	     		<form action="add_lj.do" method="post" enctype="multipart/form-data" onsubmit="return jiaoyan_all()">	     		
					<div style="margin-top:30px;">链接地址:<input type="text" name="address" id="addressId" onblur="losefocus1()" onfocus="getfocus1()"/><br/><span class="jiaoyan" id="null_span1"></span></div>	 
	     			<div style="margin-top:30px;">链接标题:<input type="text" name="title" id="titleId" onblur="losefocus2()" onfocus="getfocus2()"/><br/><span class="jiaoyan" id="null_span1"></span></div>
	     			<br/><div class="mainphoto_div">图片:<input type="file" name="name_mainphoto" id="mainphotoId" /></div>
	     			
	     			<input type="submit" value="确定" style="width:50px;" class="Mysubmit" onclick="success()"/>
	     		</form>
     		</div>
     	</div>
     	
     </div>
  </body>
</html>
